import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Created by xiebang
 * Description
 * User:小谢
 * Date:2022-01-04
 * Time:20:44
 */

class Student{

    public String name;
    public String classes;
    public Double score;
    public Student(String name,String classes, double score){
        this.name = name;
        this.classes = classes;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", classes='" + classes + '\'' +
                ", score=" + score +
                '}';
    }
}

public class TestDemo {
    public static void main(String[] args) {
        String str1 = "welcome to bit";
        String str2 = "come";
        ArrayList<Character> list = new ArrayList<>();
        int len = str1.length();
        for (int i = 0; i < len; i++) {
            char ch = str1.charAt(i);
            if (!str2.contains(ch+"")){
                list.add(ch);
            }
        }
        System.out.println(list);
//        ArrayList<Character> list = new ArrayList<>();
//        int len = str1.length();
//        for (int i = 0; i < len; i++) {
//            char ch = str1.charAt(i);
//            int j = 0;
//            for (j = 0; j < str2.length(); j++) {
//                if (ch == str2.charAt(j)){
//                    break;
//                }
//            }
//            if (j == str2.length()){
//                list.add(ch);
//            }
//        }
        System.out.println(list);
    }
    public static void main8(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(10);
        list.add(2);
        list.add(9);

        Collections.sort(list);//默认从小到大排序
        System.out.println(list);
    }
    public static void main7(String[] args) {
        List<Student> list = new ArrayList<>();
        list.add(new Student("xie","1",88.8));
        list.add(new Student("chao","2",99.9));
        list.add(new Student("bang","3",99.8));
        System.out.println(list);
    }
    public static void main6(String[] args) {
        List<Integer> list = new ArrayList<>();
        list.add(0);
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        list.add(5);
        list.add(6);
        List<Integer> list1 = list.subList(3,6);
        System.out.println(list1);

    }
    public static void main5(String[] args) {
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
//        System.out.println(list);
        System.out.println(list.set(1, 3));
        list.add(1);
        list.add(1);
//        System.out.println(list);
//        System.out.println(list.indexOf(3));
        System.out.println(list.lastIndexOf(1));

    }
    public static void main4(String[] args) {
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        System.out.println(list);
        System.out.println(list.get(0));
    }
    public static void main3(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("aa");
        list.add("bb");
        list.add("cc");
        list.add("bb");
        System.out.println(list);
        list.remove("bb");
        System.out.println(list);
    }
    public static void main2(String[] args) {
            List<Integer> list = new ArrayList<>();
            list.add(1);
            list.add(2);
            System.out.println(list);//把集合的元素以 字符串的形式输出
            list.add(0,99);
            System.out.println(list);
            list.remove(1);
        System.out.println(list);
    }
    public static void main1(String[] args) {
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        System.out.println(list);//把集合的元素以 字符串的形式输出
        list.add(0,99);
        System.out.println(list);
        List<Integer> list1 = new ArrayList<>();
        list1.add(11);
        list1.add(12);
        list.addAll(list1);
        System.out.println(list);
    }
}
